﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPF_PathSearchUtil.entity;

namespace WPF_PathSearchUtil
{
    internal class FindPathWords
    {
        public static void FindResult(ref ObservableCollection<int> findResult, ObservableCollection<PathInfo> fileList, String findWord, int findType)
        {
            findResult.Clear();
            for (int i = 0; i < fileList.Count; i++)
            {
                String fileName = fileList[i].FileName;
                if ((fileName.Equals(findWord) && findType == 0) ||
                    (fileName.IndexOf(findWord) >= 0 && findType == 1))
                {
                    findResult.Add(i);
                }
            }
        }
    }
}
